/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_sistemas_organos")
@NamedQueries({
    @NamedQuery(name = "CexSistemasOrganos.findAll", query = "SELECT c FROM CexSistemasOrganos c")})
public class CexSistemasOrganos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cso_id")
    private Integer csoId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 64)
    @Column(name = "cso_nombre")
    private String csoNombre;
    @OneToMany(mappedBy = "cexSistemasOrganos", fetch = FetchType.LAZY)
    private List<CexRevisionOrganos> cexRevisionOrganosList;

    public CexSistemasOrganos() {
    }

    public CexSistemasOrganos(Integer csoId) {
        this.csoId = csoId;
    }

    public CexSistemasOrganos(Integer csoId, String csoNombre) {
        this.csoId = csoId;
        this.csoNombre = csoNombre;
    }

    public Integer getCsoId() {
        return csoId;
    }

    public void setCsoId(Integer csoId) {
        this.csoId = csoId;
    }

    public String getCsoNombre() {
        return csoNombre;
    }

    public void setCsoNombre(String csoNombre) {
        this.csoNombre = csoNombre;
    }

    public List<CexRevisionOrganos> getCexRevisionOrganosList() {
        return cexRevisionOrganosList;
    }

    public void setCexRevisionOrganosList(List<CexRevisionOrganos> cexRevisionOrganosList) {
        this.cexRevisionOrganosList = cexRevisionOrganosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (csoId != null ? csoId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexSistemasOrganos)) {
            return false;
        }
        CexSistemasOrganos other = (CexSistemasOrganos) object;
        if ((this.csoId == null && other.csoId != null) || (this.csoId != null && !this.csoId.equals(other.csoId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.CexSistemasOrganos[ csoId=" + csoId + " ]";
    }
    
}
